{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>地推统计</title>

    <link rel="shortcut icon"
          href="{{ url_for('static', filename='favicon.ico') }}"
          type="image/x-icon">
    <link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}"
          type="image/x-icon">
    <link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css"
          rel="stylesheet">
    <link href="//cdn.bootcss.com/metisMenu/2.7.0/metisMenu.min.css"
          rel="stylesheet">
    <link href="//cdn.bootcss.com/select2/4.0.3/css/select2.min.css"
          rel="stylesheet">
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
          rel="stylesheet">
</head>
<body>
<div class="wrapper" style="margin-top: 5px">
    <form id="search-user-form" action="{{ url_for('op_bp.ground_user_statistics') }}"
          method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(search_form.invite_user_id, div_col=8, label_col=4, field_col=8) }}
        <div class="btn-group">
            <button type="submit" class="btn btn-info"
                    id="query-user-btn">
                查询
            </button>
        </div>
    </form>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>被邀人</th>
            <th>手机</th>
            <th>关注并绑定</th>
            <th>是否有效</th>
        </tr>
        </thead>
        <tbody>
        {% for each in users %}
            <tr>
                <td>{{ each.nickname }}</td>
                <td>{{ each.secret_mobile }}</td>
                <td>{{ each.invite_user.nickname }}</td>
                <td>{{ each.approval_status_display }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    {% if pagination %}
        <div class="pagination">
            {{ macros.pagination_widget(pagination, 'op_bp.ground_user_statistics', **url_kwargs) }}
        </div>
    {% endif %}
</div>

</body>
</html>